package day5

object Test1 {
  def main(args: Array[String]): Unit = {
    val list = List(5,8,3,17,2,11)

    val i: Int = list.reduce((v1, v2) => if (v1 > v2) v1 else v2)
    println(i)

    val i1: Int = list.reduce((v1, v2) => v1.max(v2))
    println(i1)

    val list2 = List("aaa","cccccccccc","bbbbb")
    val i2: String = list2.reduce((v1:String, v2) => if (v1.length > v2.length) v1 else v2)
    println(i2)

  }
}
